import { GET, POST, POST_JSON } from '@/utils/http.js'

export const getOpenId = (data) => {
    return GET('/applet/getOpenId', data)
};
export const getUserInfo = (data) => {
    return POST_JSON('/applet/getUserInfo', data)
};
export const getUpdateById = (data) => {
    return POST_JSON('/shopCompany/updateById', data)
};
// 获取短信验证码
export const getCaptcha = (data) => {
    return GET(`/ajax/loginRegister/getCaptcha`,data)
}
// 验证手机号是否存在
export const checkMobileExistCode = (data) => {
    return GET( `/ajax/loginRegister/checkMobileExistCode`,data)
}
// 登录、注册
export const loginOrRegister = (data) => {
    return POST('/ajax/loginRegister/loginOrRegister',data)
}
// 查询符合条件的标签
export const getQueryLabels = (data) => {
    return GET(`/ajax/shopCustomerTag/findAllList`,data)
}
// 添加客户-标签关系
export const saveCustomerCustomerTag = (data) => {
    return POST_JSON(`/ajax/shopCustomerTag/saveCustomerCustomerTag`,data)
}
// 称查询标签根据客户id
export const getTagByCustomer = (data) => {
    return GET(`/ajax/shopCustomerTag/getTagByCustomer`,data)
}
//添加客户-自定义标签关系
export const savePersonalityTag = (data) => {
    return POST(`/ajax/shopCustomerTag/savePersonalityTag`,data)
}
// 根据企业id更新企业信息和用户名称
export const updateCompanyUserById = (data) => {
    return POST_JSON( `/shopCompany/updateCompanyUserById`,data)
}
// 检查账号状态是否有更新
export const checkUserStatus = (data) => {
    return GET(`/user/getUserCompanyStoreInfoByUserId`,data)
}
// 微信code 换 openID
export const wxLogin = (data) => {
    return GET(`/WeChat/getOpenId`,data)
}
// 微信登录时检查是否关联手机号
export const checkRelationMobile = (data) => {
    return GET(`/user/getUserInfo`,data)
}
// 已关联手机号的微信登录
export const weChatLogin = (data) => {
    return POST('/ajax/loginRegister/weChatLogin',data)
}

// 验证微信登录要绑定的手机号是否存在
export const checkMobileExist = (data) => {
    return GET(`/ajax/loginRegister/checkMobileExist`, data)
}

// 更新用户信息、微信绑定状态
export const updateWxUserInfo = (data) => {
    return POST(`/user/updateUserInfo`, data)
}

// 未关联手机号的微信注册
export const weChatFastRegister = (data) => {
    return POST('/ajax/loginRegister/weChatFastRegister', data)
}